<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="util.*" %>
<%@ page import="model.*" %>
<%@ page import="control.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>picnew_update__chuli.jsp</title>
	</head>

	<body>
		<%
		request.setCharacterEncoding("UTF-8");
		int pic_id = ParamUtil.getInt(request,"pic_id");   
		String pic_path = request.getParameter("pic_path");    
  		String pic_introduction=ParamUtil.getString(request,"pic_introduction",null);
  		ScrollPic pic = new ScrollPic();
		pic.setPic(pic_path);
		pic.setDescription(pic_introduction);
  		
  		session.removeAttribute("picUrl");
  		
  		if(ScrollPicControl.updateScrollPic(pic,pic_id))
  			{
  				%>
		<script language="javascript">
            alert("修改成功!");
	      	window.location.href="pic.jsp";
  		</script>
		<%} else { %>
		<script language="javascript">
  				if(window.confirm("修改失败，是否重新录入?"))
				window.location.href="pic_update.jsp?pic_id=<%=pic_id%>";
				else
				window.location.href="pic.jsp";
  		</script>
		<%} 
   %>
	</body>
</html>
